package com._23DesignPattern._create.Singleton;

import java.lang.reflect.Constructor;
import java.lang.reflect.InvocationTargetException;

/**
 * @Author: huangya
 * @Date: 2018/10/19
 * @Description:
 */
public class Test {

    public static void main(String[] args) throws ClassNotFoundException, IllegalAccessException, InstantiationException, InvocationTargetException, InvocationTargetException {
//        Class c = Class.forName("com._23DesignPattern._create.Singleton.SingletonDemo");
//        Constructor constructor1 = c.getDeclaredConstructors()[0];
//        constructor1.setAccessible(true);
//        System.out.println(constructor1.newInstance());
//
//        Class c2 = Class.forName("com._23DesignPattern._create.Singleton.SingletonDemo$aaa");
//        Constructor constructor2 = c2.getDeclaredConstructors()[0];
//        constructor2.setAccessible(true);
//        System.out.println(constructor2.newInstance(constructor1.newInstance()));

//        SingletonDemo3.getInstance();
        System.out.println(111);


        ClassLoader sss = ClassLoader.getSystemClassLoader();

    }
}
